class Config:
    # 配置数据库和SQLAlchemy
    HOSTNAME = '127.0.0.1'
    PORT = '3306'
    DATABASE = 'dongbao_shopping'
    USERNAME = 'root'
    PASSWORD = 'root'

    DB_URI = "mysql+pymysql://{username}:{password}@{host}:{port}/{db}?charset=utf8".format(username=USERNAME,
                                                                                            password=PASSWORD,
                                                                                            host=HOSTNAME, port=PORT,
                                                                                            db=DATABASE)

    SQLALCHEMY_DATABASE_URI = DB_URI
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    LOGGING_LEVEL = 'DEBUG'
    LOGGING_FILE_DIR = 'logs/'
    LOGGING_FILE_MAX_BYTES = 30 * 1024 * 1024
    LOGGING_FILE_BACKUP = 100



class DevelopmentConfig(Config):
    """
        开发环境下的配置信息
    """
    DEBUG = True
    SQLALCHEMY_ECHO = True


class ProductionConfig(Config):
    """
        生产环境下的配置信息
    """
    pass
